import pdfplumber
f=pdfplumber.open('test.pdf')
g=open(file='test.txt',mode='a',encoding='utf-8')
for page in f.pages:
    text=page.extract_text()
    g.write(text)
f.close();g.close()
